

(:	We do not need the id's of the names here because we are only returning a list
	of names to the wine form to make the data entry easier. Not using the id of any wines
:)

xs:string('[')
,
let $wines := doc("wines.xml")/wines
for $wine in distinct-values($wines//wine/name)
order by $wine
return concat('["', $wine, '"],')
,
xs:string(']')